import { defineStore } from 'pinia'

export const useUserStore = defineStore('user', {
  state: () => ({
    // 默认已登录管理员
    user: {
      id: 1,
      username: 'admin',
      isAdmin: true
    }
  }),
  actions: {
    // 可选：实现登录、登出等
    login(user) {
      this.user = user
    },
    logout() {
      this.user = null
    }
  }
})
